package com.aizuda.boot.modules.business.template.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
@TableName("contract_template")
@Schema(description= "合同模板实体")
public class ContractTemplateEntity {

    @TableId( type = IdType.AUTO)
    @Schema(description = "合同模板ID")
    private Integer templateId;

    @Schema(description = "模板名称")
    private String templateName;

    @Schema(description = "模板编号，格式：年月日+序号，如：202506300001")
    private String templateCode;

    @Schema(description = "适用范围类型：department、personnel")
    private String scopeType;

    @Schema(description = "适用范围值（JSON：部门ID或人员ID列表）")
    private String scopeValue;

    @Schema(description = "创建时是否可编辑：true 可修改，false 不可修改")
    private Boolean editableWhenCreating;

    @Schema(description = "使用说明")
    private String usageInstructions;

    @Schema(description = "合同模板文件ID")
    @TableField("template_file_id")
    private Integer templateFileId;

    @Schema(description = "状态：draft 草稿，published 发布")
    private String status;

    @Schema(description = "创建时间")
    private LocalDateTime createdAt;

    @Schema(description = "更新时间")
    private LocalDateTime updatedAt;

    @Schema(description = "一级合同类型")
    private Integer contractTypeLevel1;

    @Schema(description = "二级合同类型")
    private Integer contractTypeLevel2;

    @Schema(description = "三级合同类型")
    private Integer contractTypeLevel3;

    @Schema(description = "发布者ID")
    private Long publisherId;

    @Schema(description = "系统租户键")
    @TableField("sys_tenant_key")
    private String sysTenantKey;

    @Schema(description = "模板内容（JSON格式的表单数据）")
    private String content;

    @Schema(description = "关联的流程Key")
    @TableField("process_key")
    private String processKey;
}
